<?php use_stylesheet('tablas.css') ?>
<h1>Listado de Reclamos</h1>

<table>
  <thead class="mostrar_encabezados">
    <tr>
      <th>N&uacute;mero</th>
      <th>Fecha</th>
      <th>N&uacute;mero Factura</th>
      <th>Estatus</th>
      <th>Fecha Aprobaci&oacute;n</th>
      <th>Tipo Nota</th>
      <th>Monto Nota</th>
      <?php if(sfContext::getInstance()->getUser()->hasCredential(array('administrador','administradorc','analista'),false)){?>
        <th>Editar</th>
      <?php }?>
      <?php if(sfContext::getInstance()->getUser()->hasCredential(array('administrador','administradorc','analista'),false)){?>
        <th>Eliminar</th>
      <?php }?>
    </tr>
  </thead>
  <div style="margin-left:558px;height:20px;">
	<?php if ($pager->getLastPage() > 1):?> 
		<b>Pag <?php echo $pager->getPage() ?></b>
	<?php endif ?>
  </div>
  <tbody class="mostrar">
    <?php foreach ($pager->getResults() as $Reclamo): ?>
    <tr>
      <td><a href="<?php echo url_for('reclamo/show?numero='.$Reclamo->getNumero()) ?>"><?php echo $Reclamo->getNumero() ?></a></td>
      <td><?php echo $Reclamo->getFecha() ?></td>
      <td><?php echo $Reclamo->getNumerofactura() ?></td>
      <td><?php echo $Reclamo->getEstatus() ?></td>
      <td><?php echo $Reclamo->getFechaaprob() ?></td>
      <td><?php echo $Reclamo->getTiponota() ?></td>
      <td><?php echo $Reclamo->getMontonota() ?></td>
      <?php if(sfContext::getInstance()->getUser()->hasCredential(array('administrador','administradorc','analista'),false)){?>
        <td><a href="<?php echo url_for('reclamo/edit?numero='.$Reclamo->getNumero()) ?>" class="imagen"><img src="/images/editar.png" ></a></td>
      <?php }?>
      <?php if(sfContext::getInstance()->getUser()->hasCredential(array('administrador','administradorc','analista'),false)){?>
        <td class="imagen"><?php echo link_to('<img src="/images/eliminar.png">', 'reclamo/delete?numero='.$Reclamo->getNumero(), array('method' => 'delete', 'confirm' => 'Esta seguro?')) ?></td>
      <?php }?>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<div id="nuevoVuelo" class="inline">
    <?php if(sfContext::getInstance()->getUser()->hasCredential(array('administrador','administradorc','analista'),false)){?>
        <a href="<?php echo url_for('reclamo/new') ?>">Nuevo Reclamo</a>
    <?php }?>
</div>
<div class="inline" id="paginacion" style="margin-left:422px;">
	<?php if ($pager->haveToPaginate()): ?>
	<a href="<?php echo url_for('reclamo/index?page='.$pager->getFirstPage()) ?>"><img src="/images/flecha.png"></a>
	<?php $links = $pager->getLinks();
	foreach ($links as $page): ?>
	<?php ($page == $pager->getPage()) ?>
	<a href="<?php echo url_for('reclamo/index?page='.$page) ?>"><?php echo $page ?></a>
	<?php if ($page != $pager->getCurrentMaxLink()): ?> <?php endif ?>
	<?php endforeach ?> 
	<a href="<?php echo url_for('reclamo/index?page='.$pager->getLastPage()) ?>"><img src="/images/flecha1.png"></a>
	<?php endif ?>
</div>
